<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>any</title>
</head>
<body>
<script>
  const p1 = new Promise((resolve, reject)=>{
    try {
      console.log('执行任务A')
      throw Error('A错误')
      setTimeout(()=>{
        console.log('任务A执行完成')
        resolve(111)
      },1500)
    }catch (e){
      reject(e.message)
    }
  })

  const p2 = new Promise((resolve, reject)=>{
    try {
      console.log('执行任务B')
      throw Error('B错误')
      setTimeout(()=>{
        console.log('任务B执行完成')
        resolve(222)
      },1500)
    }catch (e){
      reject(e.message)
    }
  })

  const p3 = new Promise((resolve, reject)=>{
    try {
      console.log('执行任务C')
      // throw Error('C错误')
      setTimeout(()=>{
        console.log('任务C执行完成')
        resolve(333)
      },1500)
    }catch (e){
      reject(e.message)
    }
  })

  const result = Promise.any([p1,p2,p3])
  console.log(result)
</script>
</body>
</html>